<?php
echo strip_tags("<h2>php</h2>"), "\n"; //去掉html标签，取出内容
echo ucfirst('hello'), "\n"; //首字母大写
echo ucwords("this is a book.\n");
$arr = explode(',', 'php,python,java');
//print_r($arr);
echo implode('=', $arr), "\n";

//取子串
echo substr("hello", 1), "\n"; //ello
echo substr("hello", 1, 2), "\n"; //el
echo mb_substr("中国china", 1, 2, "utf-8"), "\n"; //国c

$file = "abc2345中国.jpg";
$len = mb_strlen($file);
echo mb_substr($file, $len - 3), "\n"; //jpg 扩展名


echo strrev("hello"), "\n";//字符串倒序 olleh

//实现汉字字符串倒序
echo implode('', array_reverse(mb_str_split("中国china", 1))), "\n";

//检索查找
echo mb_strpos("中国.hello.jpg", "."), "\n"; //2 从左边找
echo strrpos("my.hello.jpg", "."), "\n"; //8 从右边找，索引正常
echo mb_strrpos("中国china", "java"), "\n";

if (mb_strrpos("中国china", "java")) {
    echo '找到了';
} else {
    echo "找不到";
}
